<?php if(!defined('BASEPATH')) exit('No direct script access allowed!');

define('TEACHERS_URL', 'return ' . 
	var_export(array(
		'home' => anchor('teacher/landings/info', 'Beranda'),
		'info' => anchor('teacher/landings/info', 'Info Pribadi'),
		'schedule' => anchor('teacher/schedule/today', 'Jadwal'),
		'schedule/today' => anchor('teacher/schedule/today', 'Hari Ini'),
		'schedule/teaching' => anchor('teacher/schedule/teaching', 'Mengajar'),
		'announcement' => anchor('teacher/announcements', 'Pengumuman'),
		'announcement/add' => anchor('teacher/announcements/add', 'Tambah Pengumuman'),
		//'comment' => anchor('teacher/comment', 'Komentar per KD'),
		'cognitive' => anchor('teacher/assignment_values', 'Nilai Kognitif'),
		'cognitive/assignment' => anchor('teacher/assignment_values', 'Nilai Tugas'),
		'cognitive/test' => anchor('teacher/test_values', 'Nilai Harian'),
		'cognitive/final' => anchor('teacher/final_values', 'Ulangan Umum'),
		//'psycho_values' => anchor('teacher/psycho_values', 'Nilai Psikomotorik'),
		//'affective_values' => anchor('teacher/affective_values', 'Nilai Afektif'),
		'extracurricular_values' => anchor('teacher/extracurricular_values', 'Nilai Ekskul'),
		'absence' => anchor('teacher/absence/student', 'Piket'),
		'absence/student' => anchor('teacher/absence/student', 'Absensi Siswa'),
		'absence/teacher' => anchor('teacher/absence/teacher', 'Absensi Guru'),
		'library' => anchor('teacher/library', 'Perpustakaan'),
		'library/book' => anchor('teacher/library/book', 'Daftar Buku'),
		'library/rent' => anchor('teacher/library/rent', 'Peminjaman'),
		'change_password' => anchor('teacher/landings/change_password', 'Ganti Password'),
	), true) . ';');

function teachers_url($key) {
	$teachers_url = eval(TEACHERS_URL);
	return $teachers_url[$key];
}

function value_limit($limits_map, $subject_id, $value) {
	$limit = $limits_map[$subject_id];
	if ($value < $limit) {
		return '<span class="remedial">'.$value.'</span>';
	}
	return $value;
}
